import request from '@/utils/request'
// import store from '@/store'

export const login = data => {
    return request({
        method: 'post',
        url: '/app/v1_0/authorizations',
        data
    })
}

// 请求验证码
export const sendSms = mobile => {
    return request({
        method: 'GET',
        url: `/app/v1_0/sms/codes/${mobile}`
    })
}
// 获取用户信息
export const getUserInfo = () => {
    return request({
        method: 'GET',
        url: '/app/v1_0/user'
        // 发送请求数据
        // headers: {
        //     // 要授权才能访问
        //     Authorization: `Bearer ${store.state.user.token}`
        // }
    })
}
// 获取频道列表数据
export const getUserChannels = () => {
    return request({
        method: 'GET',
        url: '/app/v1_0/channels'
    })
}
// 获取当前用户文章列表
export const getUserArticles = params => {
    return request({
        method: 'GET',
        url: '/app/v1_1/articles',
        params
    })
}
